package com.base.service.impl;

import com.base.bean.CommonFile;
import com.base.mapper.CommonFileMapper;
import com.base.service.ICommonFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class CommonFileServiceImpl implements ICommonFileService {

    @Autowired
    private CommonFileMapper commonFileMapper;

    @Override
    @Transactional(readOnly = true)
    public CommonFile getByFileCode(String code) {
        return commonFileMapper.selectByFileCode(code);
    }

    @Override
    @Transactional(readOnly = false)
    public int insertCommonFile(CommonFile file) {
        return commonFileMapper.insertSelective(file);
    }

    @Override
    @Transactional(readOnly = false)
    public int deleteOutCommonFile() {
        return commonFileMapper.deleteOutCommonFile();
    }

    @Override
    @Transactional(readOnly = false)
    public int updateCommonFileSelective(CommonFile file) {
        return commonFileMapper.updateByPrimaryKeySelective(file);
    }

    @Override
    @Transactional(readOnly = false)
    public int makeFileOut(String code) {
        return commonFileMapper.makeFileOut(code);
    }

}
